<script lang="ts">
	import store from '@/store';
	export default {
		props: {
			permi: {
				type: Array,
				default: () => [],
			},
		},
		render(props) {
			if (props.permi.length === 0) {
				return props.$slots.default();
			}
			const permissionAll = '*:*:*';
			const permissions = store.state.userInfo.permi;
			const hasPermissions = permissions.some(permission => {
				return permissionAll === permission || props.permi.includes(permission);
			});
			return hasPermissions ? props.$slots.default() : '';
		},
	};
</script>
